package com.dux.commons.utils;

import org.codehaus.jackson.map.ObjectMapper;

/**
 * json转换成对象
 * @author du'xiang
 *
 */
public class NewStringTransObject
{
	protected static ObjectMapper obj = new ObjectMapper();
	
	public static <T extends Object>T stringTransObject(String str,Class<T> clazz)
	{
		
		T t = null;
		
		try
		{
			t = obj.readValue(str, clazz);
		} 
		catch (Exception e)
		{
			e.printStackTrace();
		}
		return t;
	}
}
